had a test backward
authorHavoc Pennington <hp@redhat.com>
Thu, 2 Nov 2000 17:18:53 +0000 (17:18 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Thu, 2 Nov 2000 17:18:53 +0000 (17:18 +0000)
2000-11-02  Havoc Pennington  <hp@redhat.com>

* gtk/testgtk.c (create_labels): had a test backward

* gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
fields, so the dest GC ends up with the correct clip origin,
etc. Fixes a bug where colored labels didn't redraw
properly.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkgc-x11.c
gtk/testgtk.c
tests/testgtk.c

index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index f031d82e213503022a955254e3fdef0105074018..0554b29b631750ef0602fd9fba60394360940c2c 100644 (file)
@@ -1,3 +1,12 @@
+2000-11-02  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/testgtk.c (create_labels): had a test backward
+
+       * gdk/x11/gdkgc-x11.c (gdk_gc_copy): Copy the client-side GC
+       fields, so the dest GC ends up with the correct clip origin, 
+       etc. Fixes a bug where colored labels didn't redraw 
+       properly.
+
 2000-11-02  Alexander Larsson  <alexl@redhat.com>
 
        * gdk/linux-fb/gdkcolor-fb.c, gdk/linux-fb/gdkdnd-fb.c,
index a5b0088b0011f0fa49761727d5a7c52fe84ec940..0f78a853e31e3d341e0027bafbbb5d347a8e20fc 100644 (file)
@@ -683,9 +683,35 @@ gdk_gc_set_clip_region (GdkGC        *gc,
 void
 gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc)
 {
+  GdkGCX11 *x11_src_gc;
+  GdkGCX11 *x11_dst_gc;
+  
   g_return_if_fail (GDK_IS_GC_X11 (dst_gc));
   g_return_if_fail (GDK_IS_GC_X11 (src_gc));
+
+  x11_dst_gc = GDK_GC_X11 (dst_gc);
+  x11_src_gc = GDK_GC_X11 (src_gc);
   
   XCopyGC (GDK_GC_XDISPLAY (src_gc), GDK_GC_XGC (src_gc), ~((~1) << GCLastBit),
           GDK_GC_XGC (dst_gc));
+
+  dst_gc->clip_x_origin = src_gc->clip_x_origin;
+  dst_gc->clip_y_origin = src_gc->clip_y_origin;
+  dst_gc->ts_x_origin = src_gc->ts_x_origin;
+  dst_gc->ts_y_origin = src_gc->ts_y_origin;
+
+  if (src_gc->colormap)
+    g_object_ref (G_OBJECT (src_gc->colormap));
+
+  if (dst_gc->colormap)
+    g_object_unref (G_OBJECT (dst_gc->colormap));
+
+  dst_gc->colormap = src_gc->colormap;
+
+  if (x11_dst_gc->clip_region)
+    gdk_region_destroy (x11_dst_gc->clip_region);
+
+  x11_dst_gc->clip_region = gdk_region_copy (x11_src_gc->clip_region);
+
+  x11_dst_gc->dirty_mask = x11_src_gc->dirty_mask;
 }
index 2f71a75a13ae36031001d75979ea76f8b3b05809..b714be3690c8799fdef78b5f96f6dee3b8124e61 100644 (file)
@@ -2113,7 +2113,7 @@ void create_labels (void)
                                          "but this _word is <span foreground=\"purple\"><big>purple</big></span>\n"
                                          "We like <sup>superscript</sup> and <sub>subscript</sub> too");
 
-      g_return_if_fail (keyval != GDK_s);
+      g_return_if_fail (keyval == GDK_s);
       
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
index 2f71a75a13ae36031001d75979ea76f8b3b05809..b714be3690c8799fdef78b5f96f6dee3b8124e61 100644 (file)
@@ -2113,7 +2113,7 @@ void create_labels (void)
                                          "but this _word is <span foreground=\"purple\"><big>purple</big></span>\n"
                                          "We like <sup>superscript</sup> and <sub>subscript</sub> too");
 
-      g_return_if_fail (keyval != GDK_s);
+      g_return_if_fail (keyval == GDK_s);
       
       gtk_container_add (GTK_CONTAINER (frame), label);
       gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);